---
layout: "default"
title: "_ObjectiveCBridgeable"
description: "Swift documentation for '_ObjectiveCBridgeable': A Swift Array or Dictionary of types conforming to."
keywords: "_ObjectiveCBridgeable,protocol,swift,documentation,_bridgeToObjectiveC,_conditionallyBridgeFromObjectiveC,_forceBridgeFromObjectiveC,_getObjectiveCType,_isBridgedToObjectiveC,_ObjectiveCType"
root: "/v1.2"
---

<div class="intro-declaration"><code class="language-swift">protocol _ObjectiveCBridgeable</code></div>

<div class="discussion comment">
    <p>A Swift Array or Dictionary of types conforming to
<code>_ObjectiveCBridgeable</code> can be passed to Objective-C as an NSArray or
NSDictionary, respectively.  The elements of the resulting NSArray
or NSDictionary will be the result of calling <code>_bridgeToObjectiveC</code>
on each elmeent of the source container.</p>
</div>

<table class="standard">
<tr>
<th id="inheritance">Inheritance</th>
<td>
<span class="viz"><a href="hierarchy/">View Protocol Hierarchy &rarr;</a></span>
</td>
</tr>

<tr>
<th id="aliases">Associated Types</th>
<td>
<span id="aliasesmark"></span>
<div class="declaration">
<code class="language-swift">_ObjectiveCType</code>
</div>
</td>
</tr>


<tr>
<th>Import</th>
<td><code class="language-swift">import Swift</code></td>
</tr>

</table>






<h3>Static Methods</h3>
<div class="declaration" id="func--conditionallybridgefromobjectivec_inout_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--conditionallybridgefromobjectivec_inout_">static func _conditionallyBridgeFromObjectiveC(<wbr>_:<wbr>inout:)</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func--conditionallybridgefromobjectivec_inout_"><div class="p">
    <p>Try to bridge from an Objective-C object of the bridged class
type to a value of the Self type.</p>

<p>This conditional bridging operation is used for conditional
downcasting (e.g., via as?) and therefore must perform a
complete conversion to the value type; it cannot defer checking
to a later time.</p>

<p><strong>result</strong> The location where the result is written.</p>

<p><strong>Returns:</strong> true if bridging succeeded, false otherwise. This redundant
information is provided for the convenience of the runtime&#39;s dynamic_cast
implementation, so that it need not look into the optional representation
to determine success.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">static func _conditionallyBridgeFromObjectiveC(source: _ObjectiveCType, inout result: Self?) -&gt; Bool</code>
    
    
</div></div>
</div>
<div class="declaration" id="func--forcebridgefromobjectivec_inout_">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--forcebridgefromobjectivec_inout_">static func _forceBridgeFromObjectiveC(<wbr>_:<wbr>inout:)</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func--forcebridgefromobjectivec_inout_"><div class="p">
    <p>Bridge from an Objective-C object of the bridged class type to a
value of the Self type.</p>

<p>This bridging operation is used for forced downcasting (e.g.,
via as), and may defer complete checking until later. For
example, when bridging from NSArray to Array&lt;T&gt;, we can defer
the checking for the individual elements of the array.</p>

<p><strong>result</strong> The location where the result is written. The optional
will always contain a value.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">static func _forceBridgeFromObjectiveC(source: _ObjectiveCType, inout result: Self?)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func--getobjectivectype">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--getobjectivectype">static func _getObjectiveCType()</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func--getobjectivectype"><div class="p">
    <p>Must return <code>_ObjectiveCType.self</code>.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">static func _getObjectiveCType() -&gt; Any.Type</code>
    
    
</div></div>
</div>
<div class="declaration" id="func--isbridgedtoobjectivec">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--isbridgedtoobjectivec">static func _isBridgedToObjectiveC()</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func--isbridgedtoobjectivec"><div class="p">
    <p>Return true iff instances of <code>Self</code> can be converted to
Objective-C.  Even if this method returns <code>true</code>, A given
instance of <code>Self._ObjectiveCType</code> may, or may not, convert
successfully to <code>Self</code>; for example, an <code>NSArray</code> will only
convert successfully to <code>[String]</code> if it contains only
<code>NSString</code>s.</p>

    <h4>Declaration</h4>    
    <code class="language-swift">static func _isBridgedToObjectiveC() -&gt; Bool</code>
    
    
</div></div>
</div>

<h3>Instance Methods</h3>
<div class="declaration" id="func--bridgetoobjectivec">
<a class="toggle-link" data-toggle="collapse" href="#comment-func--bridgetoobjectivec">func _bridgeToObjectiveC()</a>
     <span class="required">Required</span>    
<div class="comment collapse" id="comment-func--bridgetoobjectivec"><div class="p">
    <p>Convert <code>self</code> to Objective-C</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func _bridgeToObjectiveC() -&gt; _ObjectiveCType</code>
    
    
</div></div>
</div>


